package controller;


import entity.Patient;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import service.CustomerService;

import javax.annotation.Resource;
import java.util.Map;

@Controller
@RequestMapping("/customer")
@Scope("prototype")
public class CustomerController {

    @Resource(name = "customerService")
    CustomerService customerService;


    @RequestMapping("/queryAllInfo")
    @ResponseBody
    Map<String,Object> QueryAll(Integer pageSize, Integer pageNumber, String name, String sex){
        return customerService.QuerAll(name,sex,pageSize,pageNumber);
    }

    @RequestMapping("/Update")
    @ResponseBody
    boolean UpdateCustomer(Patient patient){
       return customerService.Update(patient);
    }


    /**
     * 删除
     * @param pid
     * @return
     */
    @RequestMapping("/del")
    @ResponseBody
    boolean del(int pid){
        return  customerService.del(pid); }


}
